package com.group01.community.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.group01.community.entity.ZyCommunityInteraction;
import com.group01.community.entity.ZyOwner;
import com.group01.community.entity.vo.ZyCommunityInteractionVO;
import com.group01.community.mapper.ZyCommunityInteractionMapper;
import com.group01.community.service.ZyCommunityInteractionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 社区互动表 服务实现类
 * </p>
 *
 * @author xuxu
 * @since 2025-05-01
 */
@Service
public class ZyCommunityInteractionServiceImpl extends ServiceImpl<ZyCommunityInteractionMapper, ZyCommunityInteraction> implements ZyCommunityInteractionService {

    @Autowired(required = false)
    private ZyCommunityInteractionMapper zyCommunityInteractionMapper;

    @Override
    public IPage<ZyCommunityInteractionVO> selectAllZyCommunityInteractionVO(Long current, Long size, ZyCommunityInteractionVO zyCommunityInteractionVO, String communityName) {
        Page<ZyCommunityInteractionVO> page = new Page<>(current, size);
        page.setOptimizeCountSql(false);
        return zyCommunityInteractionMapper.selectAllZyCommunityInteractionVO(page,zyCommunityInteractionVO,communityName);
    }

    @Override
    public List<ZyCommunityInteractionVO> getHotInteraction() {
        return zyCommunityInteractionMapper.getHotInteraction();
    }
}
